Applying Color

        The main attraction of fractal programs is color.  This program tries to permit a wide use of color and application of color to the fractal.  Color Fractal Generator can handle anything from 16 to 16.7 million colors.  Varying the palette and fractal parameters results in different color application to image.  A description of the way altering parameters affects fractals is discussed in the Generating Fractals section.  Below is a detailed explanation of the different color depths and use of palettes to alter a fractal's appearance.

        The Macintosh determines the colors of pixels in an image by examining each pixel's value.  The two techniques used for converting a pixel value into a color is by using a color look-up table (CLUT) (indirect color) or by using the pixel's value as the actual color (direct color).  If a monitor is set to 16 or 256 colors (4 or 8 bits of color per pixel), then the Macintosh uses a CLUT.  If the monitor is set to more colors (or bits) per pixel, the image is direct color.

        Indirect colors require less memory to display an image, but only a limited number of colors can be displayed at once.  The value of each pixel in this type of image represents an index into the CLUT.  Each index has a corresponding color associated with it.  By referencing this table, one converts from the pixel value to a color.  Also, changing entries in the CLUT changes the color (since the index will reference a different color).  When the user selects or loads a palette, Color Fractal Generator build a CLUT with colors that would be present in such a palette.  For example, the majority of entries in a rainbow palette consist of very bright colors that span the color spectrum (from red to yellow to green to blue), while most entries in a grayscale palette are shades of gray.

        The user can specify how many entries in the palette to use.  The minimum amount is four colors, while the maximum is either 10 (for a 16 color monitor) or 250 (for a 256 color monitor).  The reason that there are some entries that are not used is to allow for other colors required by the system, such as white, black, and grays.  The maximum number of colors to use is set by the user by the Max Colors command of the Special menu.  As an image is created in a 4 bit or 8 bit color window, the colors used by the image are limited by this maximum set by the user.

        A direct color image is quite different.  Instead of using a color look-up table, the pixel values contain color information required by the monitor.  Colors are generated by applying different intensities of three primary colors:  red, green, and blue.  Each pixel contains a certain number of bits for each of these colors to represent the intensity.  With more bits per pixel, more colors can be represented.  Therefore, 32 bits per pixel (24 of which are color information) can represent millions more colors than 16 bits per pixel (15 bits of which have color data).

        Color Fractal Generator uses the advantages of direct color data to greatly increase the number of color displayed in a fractal.  The palette is used as a guideline for selecting image colors.  To maintain the highest resolution, the palette in a direct color environment is always set to 250 colors.  As a fractal is created, CFG uses the fractal data to determine which two colors in the palette to use as color guides.  CFG uses linear interpolation to select the exact color.  However, for the rainbow and gray scale palettes, an exact algorithm is used to determine the actual color.

        Whether using indirect or direct color, using palettes is necessary.  The standard palettes are displayed in a hierarchical menu found at the Standard Palettes item of the Edit menu.  All items above the separator line are default palettes which are always present in the program.  One item will be displayed below the line.  It is either No Palette Loaded or the name of a custom or loaded palette.  Initially, this item will read as No Palette Loaded.  However, if at any time a palette is edited or loaded, the name of the last custom palette will always appear as the final menu entry.

        The custom palette listed for each fractal window could be different.  Be aware that the Help window and New Parameters window display the global custom palette which is applied to new windows (if this palette is selected).  These are important concepts.  Editing or loading a palette for one window applies only to that window, not any other fractal.  Thus, you can modify the palette of any window without affecting the colors applied to another window.  Also, you can select the palette for fractals before that fractal is opened or created.

        A palette is applied to the desired window by bringing the window to the front (clicking on it) and selecting the desired palette from the hierarchical menu (Standard Palettes item of the Edit menu).  If the window is either the Help window or New Parameters window, CFG applies the palette change to the global data (affecting fractals that are created in the future).

        If an indirect color system is used, changing the palette automatically changes the fractal image since the image data only contains references into the palette, not actual color information.  For the direct color system, no image change will be evident until the fractal is regenerated as the colors are stored in the image data and the palette only acts as a guideline for selecting colors.

        It is possible that none of the palettes are to your liking.  To create an new palette or alter an existing one, select the maximum desired colors (by using the Max Colors command from the Special menu, again this only works for indirect color).  Select the palette which you wish to modify.  Now select Edit Palette from the Edit menu.  A dialog box with the palette's colors appears.

        The user may modify the palette name by using the editable text box.  You can select a color by clicking on the color with the mouse or hitting tab to move from the text field to the color field and using arrow keys to maneuver to the desired color.  To edit a color, either double click on it, or simultaneously press the Command (Apple) and Return keys.  Be careful not to just strike Return since that closes the dialog box.  When editing a color, the color picker is displayed which permits the user to select the custom color.  After selecting the color, the color will be displayed in the appropriate box.  If the colors do not appeal to you, just reset them to the same state as when you entered the Palette Editor by striking the Revert key.  Clicking the OK key makes the modified palette a custom palette and applies it to the current window.  Striking the Cancel button closes the Palette Editor without changing any colors.

        Any palette may be saved by selecting Save Palette from the Edit menu.  The currently active palette of the front-most window will be saved.  The user just needs to respond to the standard save dialog to select the palette's file name and location.  A palette may also be saved in the parameters file of a fractal.  To do so, choose Preferences from the File menu and check the Save Palette box.  Next, choose either Save or Save As from the File menu to update the current settings file or create a new one.  The palette will be saved with the settings.

        To open a saved palette, simple choose the fractal window that you want the palette change to affect (making it the front-most window).  Select Load Palette from the Edit menu and choose the palette from the standard open dialog box.  The palette will be loaded as the custom palette and this palette will be selected.  If the fractal uses indirect colors, the color change will be noted immediately.  For direct color fractals, regenerate the image to apply the new colors.  If the palette was saved in the settings file, opening this file will automatically apply the correct palette.

        NOTE about changing screen depths:  Try not change the screen depth while this program is running.  Although not as hazardous as it would have been with previous versions of CFG, it still may pose a danger.  The safest method of changing the screen depth is to quit CFG, change the depth, and re-launch the program.